package com.zxy.express.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.Date;


/**
 * 背诵素材
 *
 * @author zhangxiying ${email}
 * @since ${version} 2025-07-01
 */
@Data
@ApiModel(value = "总结复述素材")
public class SummaryMaterialDTO implements Serializable {
    private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "主键ID")
	private Long id;

//	@ApiModelProperty(value = "所属分类ID")
//	private Long categoryId;

	@ApiModelProperty(value = "素材标题")
	private String title;
	@ApiModelProperty(value = "作者")
	private String author;

	@ApiModelProperty(value = "内容")
	private String content;

	@ApiModelProperty(value = "预览内容")
	private String contentPreview;

	@ApiModelProperty(value = "难度 (1:初级, 2:中级, 3:高级)")
	private Integer difficulty;

	@ApiModelProperty(value = "练习人次统计")
	private Integer practiceCount;
	@ApiModelProperty(value = "图片url")
	private String imgUrl;
	@ApiModelProperty(value = "标签")
	private String tags;

	@ApiModelProperty(value = "关键词")
	private String keywords;

//	@ApiModelProperty(value = "是否启用")
//	private Integer isActive;

	@ApiModelProperty(value = "创建时间")
	private Date createDate;

	@ApiModelProperty(value = "")
	private Date updateDate;
	private String[] listTag;
	private String[] listKeyword;

	public String[] getListTag() {
		if (StringUtils.isNotEmpty(tags)) {
			return tags.split( ",");
		}
		return new String[]{};
	}

	public String[] getListKeyword() {
		if (StringUtils.isNotEmpty(keywords)) {
			return keywords.split( ",");
		}
		return new String[]{};
	}



}